package com.xueersi.interactivevideoeditor.manager
{
	import flash.utils.Dictionary;

	public class IDManager
	{
		private static var _instance:IDManager ;

		private var IDs:Dictionary ;
		
		public function IDManager()			
		{
			IDs = new Dictionary();
		}
		
		public static function getInstance():IDManager
		{
			if(_instance == null)
				_instance = new IDManager();
			return _instance;
		}
		
		public function getObjectID(type:String):String
		{
			if(IDs[type] != undefined)
			{
				var id:int = parseInt(IDs[type]) + 1;
				return type +"_"+ id;
			}else{
				IDs[type] = 1;
				return type +"_"+ 1;
			}			
			return type +"_"+ "noID";
		}	
	}	
}
